package cn.naughtior.shch.util;

import java.util.Random;

public class GenerateCodeUtil {
	//生成四位验证码
	public static String generateCode4(){
		Random random = new Random();
		int a = 0;
		String str = "";
		for(int i=0;i<4;i++){
			a = random.nextInt(10);
			str = str+String.valueOf(a);
		}
		return str;
	}
	//生成六位验证码
	public static String generateCode6(){
		Random random = new Random();
		int a = 0;
		String str = "";
		for(int i=0;i<6;i++){
			a = random.nextInt(10);
			str = str+String.valueOf(a);
		}
		return str;
	}
}
